package com.wsl.aop.service;

import com.wsl.aop.security.CurrentUserHolder;
import org.springframework.stereotype.Component;

/**
 * @author ：wangshuliang
 * @date ：Created in 2019/6/4 8:17
 * @description：检验类
 * @modified By：
 */
@Component
public class AuthService {
    public void checkAccess(){
        String user= CurrentUserHolder.get();
        if (!"admin".equals(user)){
            throw  new RuntimeException("operation not allow");
        }
    }
}
